//
//  WYHttpServer+WYBusiness.m
//  Boss
//
//  Created by admin on 2018/7/6.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYHttpServer+WYBusiness.h"

@implementation WYHttpServer (WYBusiness)

+(void)getFourBusinessTypeSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantBusinessType WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getBusinessTypeWithSortId:(NSNumber *)sortId SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
     [parm setValue:sortId forKey:@"sortId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantBusinessSort WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getBossLineSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantBOSSHeadLine WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getSlideShowSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantSlideshow WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
/**
 * BOSS严选 /merchant/bossChannel
 */

+(void)getBOSSChannelSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantBossChannel WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

/**
 * BOSS推荐
 */
+(void)getBOSSRecommendCurrentPage:(NSString *)currentPage WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:pageSize forKey:@"pageSize"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantBossRecommend WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}



+(void)getBusinessModuleSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessBusinessModule WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)getMoreBrandZoneWithCurrentPage:(NSString *)currentPage WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:pageSize forKey:@"pageSize"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessBrandZone WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getMoreBrandZoneByType:(NSString *)typeId WithCurrentPage:(NSString *)currentPage WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:pageSize forKey:@"pageSize"];
     [parm setValue:typeId forKey:@"typeId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessBrandZoneByType WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}


+(void)gettoBusinessTemplateWithOpportunityId:(NSString *)opportunityId WithBussinessCode:(NSString *)bussinessCode SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
     [parm setValue:opportunityId forKey:@"opportunityId"];
    [parm setValue:bussinessCode forKey:@"bussinessCode"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessToBusinessTemplate WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)sendAskWithOpportunityId:(NSString *)opportunityId WithComment:(NSString *)comment SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:opportunityId forKey:@"opportunityId"];
    [parm setValue:comment forKey:@"comment"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessAskOpportunity WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}
+(void)getIsCollectWithOpportunityId:(NSString *)opportunityId SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:opportunityId forKey:@"opportunityId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessIsCollect WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)getCollectionWithOpportunityId:(NSString *)opportunityId WithType:(NSString *)type SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:opportunityId forKey:@"opportunityId"];
    [parm setValue:type forKey:@"type"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessCollectOpportunity WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)getApplySchemeWithBusinessCode:(NSString *)businessCode WithName:(NSString *)name WithSex:(NSString *)sex WithPhone:(NSString *)phone WithVerifyCode:(NSString *)verifyCode WithAddress:(NSString *)address WithComment:(NSString *)comment SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:businessCode forKey:@"businessCode"];
    [parm setValue:name forKey:@"name"];
    [parm setValue:sex forKey:@"sex"];
    [parm setValue:phone forKey:@"phone"];
    [parm setValue:verifyCode forKey:@"verifyCode"];
    [parm setValue:address forKey:@"address"];
    [parm setValue:comment forKey:@"comment"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessApplyScheme WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}



+(void)getMerchantChannelWithSortId:(NSString *)sortId WithCurrentPage:(NSString *)currentPage WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:sortId forKey:@"sortId"];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:pageSize forKey:@"pageSize"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantChannel WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
}
+(void)getMerchantBrandWithSortId:(NSString *)sortId WithCurrentPage:(NSString *)currentPage WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:sortId forKey:@"sortId"];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:pageSize forKey:@"pageSize"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantBrand WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}



/**
 * 获取商机分享佣金
 */
+(void)getCommissionWithBusinessId:(NSString *)businessId SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:businessId forKey:@"businessId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessCommission WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

/**
 * 获取分享商机链接
 */
+(void)getCommissionShareUrlWithBusinessId:(NSString *)businessId WithCommissionId:(NSString *)commissionId SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:businessId forKey:@"businessId"];
    [parm setValue:commissionId forKey:@"commissionId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessGetShareUrl WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
/**
 * 获取商机分享用户列表
 */
+(void)getCommissionShareListWithBusinessId:(NSString *)businessId WithCurrenPage:(NSString *)currentPage SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
    [parm setValue:businessId forKey:@"businessId"];
    [parm setValue:currentPage forKey:@"currentPage"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessShareList WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}
+(void)getMerchantTopLineWithSortId:(NSString *)sortId WithCurrentPage:(NSString *)currentPage WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:sortId forKey:@"sortId"];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:pageSize forKey:@"pageSize"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantHeadline WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}


+(void)getBrowseListWithBusinessId:(NSString *)businessId WithCurrentPage:(NSString *)currentPage SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:businessId forKey:@"businessId"];
    [parm setValue:currentPage forKey:@"currentPage"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlBusinessBrowseList WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}
+(void)getMerchantAdvertisingSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlMerchantAdvertising WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}







@end
